<?php


namespace app\admin\validate\setting;

use tmcore\base\BaseValidate;

/**
 * 区域验证器
 */
class AreaValidate extends BaseValidate
{

    protected $rule = [
        'id'   => 'require',
        'name' => 'require',
        'code' => 'require',
        'pid' => 'require',
        'level' => 'require',
    ];

    /**
     * 增加区域参数场景
     * @return AreaValidate
     */
    public function sceneAdd()
    {
        return $this->only(['name', 'code', 'pid', 'level']);
    }

    /**
     * 编辑区域参数场景
     * @return AreaValidate
     */
    public function sceneEdit()
    {
        return $this->only(['id','name', 'code']);
    }

    /**
     * 删除区域场景
     * @return AreaValidate
     */
    public function sceneDelete()
    {
        return $this->only(['id']);
    }

    /**
     * 获取区域信息场景
     * @return AreaValidate
     */
    public function sceneDetail()
    {
        return $this->only(['id']);
    }

}